package org.dromara.hrp.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.wms.domain.WmsOrderLine;

import java.io.Serial;
import java.util.List;

/**
 * 线索商机对象 hrp_lead
 *
 * @author wenrui
 * @date 2024-03-21
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hrp_lead")
public class HrpLead extends TenantEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 线索ID
     */
    @ExcelProperty(value = "id")
    @NotNull(message = "id不能为空", groups = { EditGroup.class })
    @TableId(value = "id")
    private Long id;

    /**
     * 线索名称
     */
    @ExcelProperty(value = "名称")
    @NotBlank(message = "名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String name;

    /**
     * 客户id
     */
    @ExcelProperty(value = "客户id")
    private Long partnerId;

    /**
     * 客户名称
     */
    @ExcelProperty(value = "客户名称")
    @TableField(exist = false)
    private String partnerName;

    /**
     * 归属销售
     */
    @ExcelProperty(value = "归属销售")
    @NotBlank(message = "归属销售不能为空", groups = { AddGroup.class, EditGroup.class })
    private String salesId;

    /**
     * 归属销售名
     */
    @ExcelProperty(value = "归属销售名")
    @TableField(exist = false)
    private String salesName;

    /**
     * 客户来源
     */
    @ExcelProperty(value = "客户来源",converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "hrp_lead_source")
    @NotBlank(message = "客户来源不能为空", groups = { AddGroup.class, EditGroup.class })
    private String source;

    /**
     * 客户阶段
     */
    @ExcelProperty(value = "客户阶段",converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "hrp_lead_stage")
    @NotBlank(message = "客户阶段不能为空", groups = { AddGroup.class, EditGroup.class })
    private String stage;

    /**
     * 失去原因
     */
    @ExcelProperty(value = "失去原因",converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "hrp_lead_lost_reason")
    private String lostReason;

    /**
     * 下次跟单时间
     */
    @ExcelProperty(value = "跟单时间")
    private Date nextTime;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注")
    private String remark;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @TableField(exist = false)
    private List<HrpLeadQuote> quoteList;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @TableField(exist = false)
    private List<HrpLeadComment> commentList;



}
